import type { BasicGuessInstance } from '@/components/components'
import { ref } from 'vue'

/**
 * 猜你喜欢组合式函数
 */
export const useBasicGuessComposables = () => {
  // 1. 获取组件实例
  const basicGuessRef = ref<BasicGuessInstance>()

  /**
   * 触底事件，然后加载更多
   */
  const getMoreData = () => {
    console.log('到底了。。。')
    basicGuessRef.value?.getMore()
  }

  // 返回 ref 和事件处理函数
  return {
    basicGuessRef,
    getMoreData,
  }
}
